﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AstoriaPlus
{
	/// <summary>
	/// Provides a bag of context state for the behavior pipeline of an Astoria service.
	/// </summary>
	public interface IPipelineContext
	{
		/// <summary>
		/// Determines whether the context contains an entry of the given type <typeparamref name="T"/>.
		/// </summary>
		bool Has<T>();

		/// <summary>
		/// Determines whether the context contains an entry of the given type <typeparamref name="T"/> 
		/// and key.
		/// </summary>
		bool Has<T>(object key);

		/// <summary>
		/// Gets the entry of the given type <typeparamref name="T"/>.
		/// </summary>
		T Get<T>();

		/// <summary>
		/// Gets the entry of the given type <typeparamref name="T"/> and key.
		/// </summary>
		T Get<T>(object key);

		/// <summary>
		/// Gets the value of the entry of the given type <typeparamref name="T"/>.
		/// </summary>
		void Set<T>(T value);

		/// <summary>
		/// Sets the value of the entry of the given type <typeparamref name="T"/> and key.
		/// </summary>
		void Set<T>(object key, T value);
	}
}
